﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Demo
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (txtUser.Text == "" || txtPwd.Text == "")
            {
                lblMessage.Text = "用户名或密码不能为空!";
            }
            else
            {
                if (txtUser.Text=="admin")
                {
                    Response.Write("<script>alert('不允许使用管理员账号，请重新注册');window.location.href='rest.aspx'</script>");
                }
                else
                {
                    string end = Server.UrlEncode(txtUser.Text);
                    Response.Redirect("Index.aspx?user="+Server.UrlEncode(end));
                }
            }
        }
    }
}